package com.yyfax.pay.depository.dao;

import org.apache.ibatis.annotations.Param;

import com.yyfax.pay.depository.domain.FuiouWithdraw;

/**
 * 提现DAO
 *
 * @author yejc
 * @date 2017-11-09
 * @since v2.0.0
 */
public interface FuiouWithdrawDao {
    /**
     * 根据主键删除
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     */
    int deleteByPrimaryKey(String busiId);

    /**
     * 保存实体对象
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     */
    int insert(FuiouWithdraw record);

    /**
     * 根据主键查询
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     */
    FuiouWithdraw selectByPrimaryKey(String busiId);

    /**
     * 根据主键查询
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     */
    int updateByPrimaryKey(FuiouWithdraw record);

    /**
     * 根据订单号和商户号查询
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     * @param orderId
     * @param merchantCode
     * @return
     */
    FuiouWithdraw selectByOrderIdMerchantCode(@Param("orderId") String orderId, @Param("merchantCode") String merchantCode);

    /**
     * 根据主键和状态更新状态
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     * @param oriState
     * @param tarState
     * @param busiId
     * @param currentDateTime
     * @return
     */
    int updateStateByBusiId(@Param("oriState") String oriState, @Param("tarState") String tarState,  @Param("busiId") String busiId, @Param("currentDateTime") String currentDateTime);

    /**
     * 根据主键更新状态和响应
     *
     * @author yejc
     * @date 2017-11-09
     * @since v2.0.0
     * @param state
     * @param busiId
     * @param currentDateTime
     * @param rspCode
     * @param rspMsg
     * @return
     */
    int updateStateAndRspByBusiId(@Param("state") String state, @Param("busiId") String busiId, @Param("currentDateTime") String currentDateTime, @Param("rspCode") int rspCode, @Param("rspMsg") String rspMsg);

}